#!/usr/bin/env python
# encoding: utf-8

"""The base class for Storage backends. If you want to develop your own
Storage class it has to be inherited from this class.
Provides common attributes for all storage classes.
"""

class BaseStorage:
    """Defines the common attributes and methods to make the backend
    work via the interface spyro.session.Session.
    It is meant to be usable as a dict-like object, providing the functions
    to set, get and delete items, or the whole session data.
    """

    def __init__(self):
        raise NotImplementedError()

    def __setitem__(self, key, value):
        raise NotImplementedError()

    def __getitem__(self, key):
        raise NotImplementedError()

    def __delitem__(self, key):
        raise NotImplementedError()
    
    def __contains__(self, key):
        raise NotImplementedError()

    def destroy(self):
        raise NotImplementedError()
